home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / EDUCATE / GRAPHITI.ARJ / GR.DOC next >
Text File  |  1992-07-09  |  21KB  |  521 lines

  1.  
  2.  
  3.  
  4.      GRAPHITI V1.05 Copyright (c) 1991-1992 Copy Con Incorporated    Page 1
  5.  
  6.  
  7.      TO PRINT THIS FILE, TYPE "COPY GR.DOC PRN" AT THE DOS PROMPT.
  8.  
  9.  
  10.      OVERVIEW
  11.      --------
  12.      GRAPHITI is a mathematical function plotter, capable of displaying
  13.      user-defined two-dimensional, three-dimensional, and polar functions,
  14.      with the option of saving the output as a GIF file. GRAPHITI will work
  15.      with any MS-DOS compatible computer with a CGA, Hercules, MCGA, EGA,
  16.      VGA, or SVGA graphics adapter, and will take advantage of a math
  17.      coprocessor if available.
  18.  
  19.  
  20.      DISCLAIMER
  21.      ----------
  22.      GRAPHITI is distributed on an "AS IS" basis without warranty,
  23.      expressed or implied. Considerable testing effort has been expended,
  24.      but the user is advised to check the program's suitability before
  25.      relying on it. The user assumes full risk as to the results of using
  26.      this program. Any liability of the author will be limited exclusively
  27.      to product replacement. In no event shall the author be liable for any
  28.      consequential damages arising from the use, or inability to use this
  29.      program.
  30.  
  31.  
  32.      REGISTRATION
  33.      ------------
  34.      The unregistered version of GRAPHITI is freely distributable and fully
  35.      functional, and may be used for a 30-day trial period. If you plan to
  36.      continue using GRAPHITI after the trial period, you are obligated to
  37.      pay the modest registration fee of $20. Registered users will receive
  38.      the latest version of GRAPHITI with the "nag" messages removed, one
  39.      free upgrade upon request, and half-priced subsequent upgrades.
  40.  
  41.      All registration information is contained in the REGISTER.TXT file. If
  42.      that file is missing, register by sending a check or money order for
  43.      $20 in U.S. dollars, drawn on a U.S. bank, to:
  44.  
  45.         Copy Con Incorporated
  46.         PO Box 23255
  47.         Baltimore MD 21203-5255
  48.  
  49.      We thank you for your support.
  50.  
  51.  
  52.  
  53.      GRAPHITI V1.05 Copyright (c) 1991-1992 Copy Con Incorporated    Page 2
  54.  
  55.  
  56.      OPERATION
  57.      ---------
  58.      GRAPHITI is activated from the command line, using the format
  59.  
  60.         GR expression [options]
  61.  
  62.      To stop a plot in progress, press any key, and the plotting will stop;
  63.      another keypress will exit the program. Ctrl-Break will stop and exit
  64.      immediately.
  65.  
  66.  
  67.      EXPRESSIONS
  68.      -----------
  69.      Expressions are mathematical formulas built with the supported
  70.      functions, operators, constants and variables. Expressions must be in
  71.      one of the following forms:
  72.  
  73.         x=f(y)    2-dimensional vertical    Angles specified in radians
  74.         y=f(x)    2-dimensional horizontal    "        "     "     "
  75.         z=f(x,y)  3-dimensional               "        "     "     "
  76.         r=f(p)    Polar                       "        "     "  degrees
  77.  
  78.  
  79.      FUNCTIONS
  80.      ---------
  81.      Following are the functions that GRAPHITI supports:
  82.  
  83.         Function  Description
  84.         --------  -----------
  85.           abs     Absolute value
  86.           acos    Arc cosine
  87.           asin    Arc sine
  88.           atan    Arc tangent
  89.           ceil    Smallest integer not less than input value (rounds up)
  90.           cos     Cosine
  91.           cosh    Hyperbolic cosine
  92.           csc     Cosecant
  93.           ctn     Cotangent
  94.           cub     Cube root
  95.           exp     E to the power of input value
  96.           flr     Largest integer not more than input value (rounds down)
  97.           frac    Fractional part of input value
  98.           int     Integer part of input value
  99.           ln      Natural logarithm
  100.           log     Natural logarithm (same as LN)
  101.           logt    Base 10 logarithm
  102.           rand    Random integer between 1 and input value (max 32767)
  103.           sec     Secant
  104.           sgn     Sign of input value (positive=1, negative=-1, zero=0)
  105.           sin     Sine
  106.           sinh    Hyperbolic sine
  107.           sqr     Square (x^2)
  108.           sqrt    Square root
  109.           tan     Tangent
  110.           tanh    Hyperbolic tangent
  111.  
  112.  
  113.  
  114.      GRAPHITI V1.05 Copyright (c) 1991-1992 Copy Con Incorporated    Page 3
  115.  
  116.  
  117.      FUNCTIONS (continued)
  118.      ---------------------
  119.      Parentheses are optional when using functions; if they are not used,
  120.      only the first value following the function will be considered the
  121.      argument. For example:
  122.  
  123.         y=sin x      is equivalent to   y=sin(x)
  124.         y=sin x/2    is equivalent to   y=sin(x)/2
  125.         y=sin(x/2)   is equivalent to   y=sin(x/2)
  126.  
  127.      Use of functions without parentheses is potentially erroneous, and it
  128.      is generally preferable to use parens to indicate function arguments.
  129.  
  130.  
  131.      OPERATORS
  132.      ---------
  133.      Each operator has a precedence, and operators with higher precedence
  134.      are evaluated before operators with lower precedence. Operators with
  135.      equal precedence are handled from left to right within a function.
  136.  
  137.      Precedence is indicated by order in the following table (the first
  138.      line has the highest precedence):
  139.  
  140.         Operators  Description
  141.         ---------  -----------
  142.            ( )     Left parenthesis,Right parenthesis
  143.             !      Unary factorial
  144.            + -     Unary sign
  145.             ^      Exponential
  146.           * / %    Multiplication,Division,Modulus
  147.            + -     Addition,Subtraction
  148.  
  149.      Where it is not ambiguous, multiplication can be indicated by
  150.      adjacency: 8(6-4) = 8*(6-4) = 16. Implicit multiplication is
  151.      potentially erroneous, and it is generally preferable to use the '*'
  152.      symbol to indicate multiplication.
  153.  
  154.  
  155.      CONSTANTS
  156.      ---------
  157.      GRAPHITI supports numeric constants, as well as two alphabetic
  158.      constants, PI and E. Alphabetic constants cannot directly follow
  159.      functions; use "y=sin x" or "y=sin(x)", not "y=sinx". Numeric
  160.      constants need not be separated from functions with spaces; "y=sin3"
  161.      is okay.
  162.  
  163.      Numerical constants are entered just as you would ordinarily write
  164.      them. They can be preceeded with optional + or - signs. The following
  165.      are all valid numerical entries:
  166.  
  167.                         6.78    0.678   .678   -678
  168.  
  169.      Blanks are not permitted in numbers; the expression "7 8" would be
  170.      evaluated as 7 times 8, not 78.
  171.  
  172.  
  173.  
  174.      GRAPHITI V1.05 Copyright (c) 1991-1992 Copy Con Incorporated    Page 4
  175.  
  176.  
  177.      CONSTANTS (continued)
  178.      ---------------------
  179.      Alphabetic constants can be used as easily as real numbers; just be
  180.      careful not to string them together with functions, variables, and
  181.      other alphabetic constants; instead of "z=lnx+ypi", use
  182.      "z=ln x + y pi", or "z=ln(x)+y*pi". "y=3pi/x" and "x=3e" are valid, as
  183.      GRAPHITI can tell where one constant ends and another begins.
  184.  
  185.      Following are the approximate values of the alphabetic constants:
  186.  
  187.         PI = 3.14159265
  188.         E  = 2.71828183
  189.  
  190.  
  191.      VARIABLES
  192.      ---------
  193.      The three variables (X, Y, and P) change value from their lower range
  194.      to their higher range (with increments determined by the D and L
  195.      options), and the function's value is plotted accordingly. Variables
  196.      can be used in the following functions:
  197.  
  198.         Variable  Functions
  199.         --------  ---------
  200.            X      y=f(x), z=f(x,y)
  201.            Y      x=f(y), z=f(x,y)
  202.            P      r=f(p)
  203.  
  204.      The variables are plotted according to the functions they are used in:
  205.  
  206.            x=f(y), y=f(x)    |        z=f(x,y)        |        r=f(p)
  207.         ---------------------|------------------------|--------------------
  208.                  y           |            z  -y(back) |           r
  209.                  |           |            | /         |           |
  210.                  |           |            |/          |           |
  211.         -x ------+------ x   |   -x ------+------ x   |   r ------+------ r
  212.                  |           |           /|           |           |
  213.                  |           |          / |           |           |
  214.                 -y           |  (fore)y  -z           |           r
  215.  
  216.  
  217.      OPTIONS
  218.      -------
  219.      Options must be in the form "OPTION:value[,value...]", as in "u:2" or
  220.      "rx:-3,5". Case is not important. Separate options with spaces.
  221.  
  222.         Option  Description
  223.         ------  -----------
  224.           A     Axis lines - determines whether the X- Y- and/or Z-axes
  225.                 will be drawn. Default is Y.
  226.  
  227.  
  228.  
  229.      GRAPHITI V1.05 Copyright (c) 1991-1992 Copy Con Incorporated    Page 5
  230.  
  231.  
  232.      OPTIONS (continued)
  233.      -------------------
  234.  
  235.         Option  Description
  236.         ------  -----------
  237.           C     Color - the color of the plotted graph. Range is 0 thru the
  238.                 maximum amount of colors for the video screen. Default is 1
  239.                 for a monochrome screen, 13 for a color screen. Colors are
  240.                 as follows:
  241.  
  242.                    COLOR                MONOCHROME
  243.                    Num  Color           Num  Color
  244.                    ---  -----           ---  ----
  245.                     0   Black            0   Black
  246.                     1   Blue             1   White
  247.                     2   Green
  248.                     3   Cyan
  249.                     4   Red
  250.                     5   Magenta
  251.                     6   Brown
  252.                     7   Light Grey
  253.                     8   Dark Grey
  254.                     9   Light Blue
  255.                    10   Light Green
  256.                    11   Light Cyan
  257.                    12   Light Red
  258.                    13   Light Magenta
  259.                    14   Yellow
  260.                    15   White
  261.  
  262.                 For 3D graphs, the fill color and fill style can also be
  263.                 specified. Use the above chart for the fill colors (default
  264.                 is 0). Fill styles are as follows (default is 1):
  265.  
  266.                    Num  Style
  267.                    ---  -----
  268.                     0   No fill (for see-thru graphs; plots faster)
  269.                     1   Solid fill
  270.                     2   Fill with ---
  271.                     3   Fill with ///
  272.                     4   Fill with ///, thick lines
  273.                     5   Fill with \\\, thick lines
  274.                     6   Fill with \\\
  275.                     7   Light hatch fill
  276.                     8   Heavy crosshatch fill
  277.                     9   Interleaving line fill
  278.                    10   Widely spaced dot fill
  279.                    11   Closely spaced dot fill
  280.  
  281.           D     Dot resolution - number of pixels per scan line for 2D and
  282.                 polar graphs. Range is 1 thru 10; the amount of pixels will
  283.                 be 2^(D-1). Default is 1.
  284.  
  285.  
  286.  
  287.      GRAPHITI V1.05 Copyright (c) 1991-1992 Copy Con Incorporated    Page 6
  288.  
  289.  
  290.      OPTIONS (continued)
  291.      -------------------
  292.  
  293.         Option  Description
  294.         ------  -----------
  295.           FS    GIF file save - GIF filename to save screen to after
  296.                 plotting. A pixel will appear on the right side of the
  297.                 current line being processed. When the pixel reaches the
  298.                 bottom, the screen has been saved; if any key is pressed
  299.                 before that time, the incomplete GIF file will be deleted.
  300.                 Default is none.
  301.  
  302.           L     Line resolution - number of lines per unit for 3D graphs.
  303.                 Range is 1 thru 5; number of lines will be 2^(L-1). Default
  304.                 is 2.
  305.  
  306.           RP    Range of P - low and high range of variable P in r=f(p).
  307.                 Ranges are any two numbers, as long as the low range is
  308.                 less than the high range. If only one number is entered,
  309.                 the range will be the negative value of the number to the
  310.                 positive value. Defaults are 0,360.
  311.  
  312.           RX    Range of X - low and high range of variable X in y=f(x) and
  313.                 z=f(x,y). Low range is -15 times the unit value (see option
  314.                 U) to the high range. High range is the low range to 15
  315.                 times the unit value. That can be expressed as:
  316.  
  317.                   -15*U <= low range < high range <= 15*U
  318.  
  319.                 If only one number is entered, the range will be the
  320.                 negative value of the number to the positive value.
  321.                 Defaults are -15,15.
  322.  
  323.           RY    Range of Y - low and high range of variable Y in x=f(y) and
  324.                 z=f(x,y). Ranges and defaults:
  325.  
  326.                    Graph   Range (See option U)                    Defaults
  327.                   -------- --------------------------------------- --------
  328.                    x=f(y)  -10*U <= low range < high range <= 10*U  -10,10
  329.                   z=f(x,y) -15*U <= low range < high range <= 15*U  -15,15
  330.  
  331.                 If only one number is entered, the range will be the
  332.                 negative value of the number to the positive value.
  333.  
  334.  
  335.  
  336.      GRAPHITI V1.05 Copyright (c) 1991-1992 Copy Con Incorporated    Page 7
  337.  
  338.  
  339.      OPTIONS (continued)
  340.      -------------------
  341.  
  342.         Option  Description
  343.         ------  -----------
  344.           S     SVGA mode - type of Super VGA card in your system. Range is
  345.                 0 thru 6, where:
  346.  
  347.                   Num  SVGA Card
  348.                   ---  ---------
  349.                    0   None
  350.                    1   ATI
  351.                    2   Orchid
  352.                    3   Paradise
  353.                    4   VEGA
  354.                    5   Compro
  355.                    6   SOTA
  356.  
  357.                 This option does nothing unless VGA/SVGA is detected, but
  358.                 GRAPHITI cannot tell what type of SVGA card is present, so
  359.                 do not use the S option without the proper card. If you are
  360.                 not sure what type of video card you have, don't mess with
  361.                 the S option - you may do harm to your video system.
  362.                 Default is 0.
  363.  
  364.           T     True graph - whether 2D and polar graphs will just display
  365.                 the plotted points (Y), or also attempt to draw connecting
  366.                 lines between them (N). Default is N.
  367.  
  368.           U     Unit value - value of one unit (used for scaling). There
  369.                 are ten units from the center of the screen to the top, and
  370.                 the units are marked on the axis lines. Range is .0001 to
  371.                 10000. Default is 1.
  372.  
  373.  
  374.      ERROR MESSAGES
  375.      --------------
  376.      Following are error messages you may come across, along with their
  377.      descriptions and corresponding DOS errorlevels:
  378.  
  379.         Level  Message & Description
  380.         -----  ---------------------
  381.           1    Invalid command line options - GRAPHITI cannot understand
  382.                your input. Functions must start with "X=", "Y=", "Z=", or
  383.                "R=". Options must be in the form "OPTION:value[,value...]",
  384.                as in "u:2" or "rx:-3,5". Don't type the quotes! Case is not
  385.                important.
  386.  
  387.           2    Graphics hardware not detected - either your computer is not
  388.                equipped with a graphics adapter, or GRAPHITI cannot
  389.                determine what type of adapter it is.
  390.  
  391.  
  392.  
  393.      GRAPHITI V1.05 Copyright (c) 1991-1992 Copy Con Incorporated    Page 8
  394.  
  395.  
  396.      ERROR MESSAGES (continued)
  397.      --------------------------
  398.  
  399.         Level  Message & Description
  400.         -----  ---------------------
  401.           3    Abnormal program termination - either we erred in trapping a
  402.                math function, or the program has been corrupted somehow.
  403.                (Please drop us a line describing everything that led up to
  404.                this error, if you happen to come across it.)
  405.  
  406.           4    Invalid function '(function)' - you have attempted to use an
  407.                unsupported function. If it's a common function, let us
  408.                know, and we will add it.
  409.  
  410.           5    Invalid operator '(op)' - you have attempted to use an
  411.                unsupported operator. If it's a common operator, let us
  412.                know, and we will add it.
  413.  
  414.           6    Mixmatched parentheses - either there were an uneven amount
  415.                of parentheses, or a right paren was encountered before its
  416.                matching left paren.
  417.  
  418.           7    Invalid use of functions - functions cannot be directly
  419.                followed by an operator (unless the operator is a "+" or "-"
  420.                indicating the sign of the value that follows).
  421.  
  422.           8    Invalid use of operators - operators cannot be directly
  423.                followed by other operators (unless the second operator is a
  424.                "+" or "-" indicating the sign of the value that follows).
  425.  
  426.           9    Formula too complex - your function has 128 or more
  427.                references to constants and variables.
  428.  
  429.          10    Formula cannot reference itself - the function variable on
  430.                the left side of the equals sign cannot be referred to on
  431.                the right side (as in "y=sin y").
  432.  
  433.          11    Variable '(variable)' cannot be used in this function -
  434.                function must be in the form "x=f(y)", "y=f(x)", "z=f(x,y)",
  435.                or "r=f(p)".
  436.  
  437.          12    Unable to open file '(file)' - the named GIF file cannot be
  438.                opened for writing.
  439.  
  440.  
  441.  
  442.      GRAPHITI V1.05 Copyright (c) 1991-1992 Copy Con Incorporated    Page 9
  443.  
  444.  
  445.      EXAMPLES
  446.      --------
  447.      GR y=sin x c:3 rx:0,10
  448.  
  449.         displays a sine wave, using color #3 (cyan), and shows only the
  450.         part of the graph where X falls between 0 and 10.
  451.  
  452.      GR x=tan(y) t:y d:4
  453.  
  454.         displays a tangent wave using true graphing and a dot resolution of
  455.         4. If true graphing had been kept off, the asymptotes would have
  456.         been displayed, and they are not an actual part of the tangent
  457.         function. The resolution was increased so that more of the function
  458.         points would be plotted. (The D option is generally not needed if
  459.         true graphing is left off.)
  460.  
  461.      GR r=p u:360 rp:7200 a:n
  462.  
  463.         displays a polar graph with a unit value of 360 (meaning there are
  464.         now 3600 units from the center of the screen to the top), showing
  465.         all values where P >= -7200 and <= 7200 (since only one number was
  466.         used for the range), and keeping the axis lines off.
  467.  
  468.      GR y=sqr abs cos x sgn cos x s:3
  469.  
  470.         displays a 2D graph, using a Paradise SVGA card at 800x600. The
  471.         function could also have been written as
  472.  
  473.            GR y=sqr(abs(cos(x)))*sgn(cos(x)) s:3 ,
  474.  
  475.         either way is fine. BTW, the S option does nothing unless VGA/SVGA
  476.         is detected, but GRAPHITI cannot tell what type of SVGA card is
  477.         present, so do not use the S option without the proper card. If you
  478.         are not sure what type of video card you have, don't mess with the
  479.         S option - you may do harm to your video system.
  480.  
  481.      GR z=cos((x*x+y*y)/20) l:3 c:2,1,9 fs:3d_cos
  482.  
  483.         displays a 3D graph with a line resolution of 3 (l:3), in color #2
  484.         (green), with a fill color of 1 (blue), and fill style #9
  485.         (interleaving line fill). When finished, the screen will be saved
  486.         to file 3D_COS.GIF (.GIF is appended by default).
  487.  
  488.      GR z=2sin(x*y/8) l:3 c:9,,0
  489.         displays a sine graph, with a fill style of 0 (no fill), which will
  490.         produce a see-thru graph. A fill color was not specified, but it
  491.         wouldn't have shown up anyway, due to the fill style.
  492.  
  493.  
  494.  
  495.      GRAPHITI V1.05 Copyright (c) 1991-1992 Copy Con Incorporated   Page 10
  496.  
  497.  
  498.      CREDITS
  499.      -------
  500.      GIF encoding routines based on code by David Rowley.
  501.  
  502.      SVGA driver written by John Sieraski.
  503.  
  504.      Much thankage to John "Catman" Lalmond and to Deborah Carey, the
  505.      original beta-testers.
  506.  
  507.  
  508.      CORRESPONDENCE
  509.      --------------
  510.      If you have questions, comments, suggestions, bug reports, etc.,
  511.      feel free to contact us by one of the following methods:
  512.  
  513.      1: By modem at The Programmer's Corner (301-596-7692 or 410-995-6873).
  514.         Send a message to user number 3000, and check back in a couple of
  515.         work days for a reply.
  516.  
  517.      2: By U.S. Mail at the address given on the first page. If you would
  518.         like a reply, please include a self-addressed, stamped envelope.
  519.  
  520.      We look forward to hearing from you.
  521.